<template>
  <router-view></router-view>
</template>

<script lang="ts" setup>
import { useStore } from 'vuex'
// 线上禁用调试
// if (document.location.host == 'www.gzbimai.com') {
//   ;(() => {
//     function block() {
//       if (
//         window.outerHeight - window.innerHeight > 200 ||
//         window.outerWidth - window.innerWidth > 200
//       ) {
//         document.body.innerHTML = '检测到非法调试，请关闭后刷新重试！'
//       }
//       setInterval(() => {
//         ;(function () {
//           return false
//         })
//           ['constructor']('debugger')
//           ['call']()
//       }, 50)
//     }
//     try {
//       block()
//     } catch (err) {}
//   })()
// }
const store = useStore()
const saveState = () => {
  store.commit('clear_tabs_list')
  var item = {
    name: 'index',
    path: '/index',
    label: '数据分析',
    is_active: true,
  }
  store.commit('add_tabs_list', item)
  sessionStorage.setItem('state', JSON.stringify(store.state))
}
window.addEventListener('unload', saveState)
let theme = localStorage.getItem('theme')
  ? JSON.parse(localStorage.getItem('theme'))
  : 'default'
document.documentElement.setAttribute('theme', theme)
</script>

<style lang="scss">
html {
  width: 100% !important;
  height: 100% !important;
  color: #333;
}
body {
  width: 100% !important;
  height: 100% !important;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  font-size: 14px;
  height: 100%;
}
.container {
  position: relative;
}
.pagination {
  position: absolute;
  bottom: 0;
  left: 20px;
  width: 100%;
}
</style>
